home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SRC\IRCII-2.6\INCLUDE\WINDOW.H < prev    next >
C/C++ Source or Header  |  1995-01-03  |  8KB  |  262 lines

  1. /*
  2.  * window.h: header file for window.c 
  3.  *
  4.  * Written By Michael Sandrof
  5.  *
  6.  * Copyright(c) 1990 
  7.  *
  8.  * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
  9.  *
  10.  * @(#)$Id: window.h,v 1.6 1994/07/02 02:38:10 mrg Stab $
  11.  */
  12.  
  13. #ifndef _WINDOW_H_
  14. #define _WINDOW_H_
  15.  
  16. /*
  17.  * Define this if you want to play with the new window feature, 
  18.  * CREATE, that allows you to start new iscreen or xterm windows
  19.  * connected to the ircII client.
  20.  */
  21. #define    WINDOW_CREATE
  22.  
  23. #if defined(M_UNIX)
  24. #undef WINDOW_CREATE
  25. #endif /* M_UNIX */
  26.  
  27. /*
  28.  * Define this if you want ircII to scroll after printing a line,
  29.  * like it used to (2.1.5 and back era), not before printing the
  30.  * line.   Its a waste of a line to me, but what ever people want.
  31.  * Thanks to Veggen for telling me what to do for this.
  32.  */
  33. #undef SCROLL_AFTER_DISPLAY
  34.  
  35. #include "hold.h"
  36. #include "lastlog.h"
  37. #include "edit.h"
  38. #include "menu.h"
  39.  
  40. /* used by the update flag to determine what needs updating */
  41. #define REDRAW_DISPLAY_FULL 1
  42. #define REDRAW_DISPLAY_FAST 2
  43. #define UPDATE_STATUS 4
  44. #define REDRAW_STATUS 8
  45.  
  46. struct    WindowMenuTag
  47. {
  48.     Menu    *menu;
  49.     int    lines;
  50.     int    items_per_line;
  51.     int    cursor;
  52. };
  53.  
  54. typedef    struct    WindowMenuTag    WindowMenu;
  55.  
  56. /* NickList: structure for the list of nicknames of people on a channel */
  57. typedef struct nick_stru
  58. {
  59.     struct    nick_stru    *next;    /* pointer to next nickname entry */
  60.     char    *nick;            /* nickname of person on channel */
  61.     int    chanop;            /* True if the given nick has chanop */
  62. }    NickList;
  63.  
  64. typedef    struct    DisplayStru
  65. {
  66.     char    *line;
  67.     int    linetype;
  68.     struct    DisplayStru    *next;
  69. }    Display;
  70.  
  71. #define    LT_UNLOGGED    0
  72. #define    LT_LOGHEAD    1
  73. #define    LT_LOGTAIL    2
  74.  
  75. struct    ScreenStru;    /* ooh! */
  76.  
  77. typedef    struct    WindowStru
  78. {
  79.     unsigned int    refnum;        /* the unique reference number,
  80.                      * assigned by IRCII */
  81.     char    *name;            /* window's logical name */
  82.     int    server;            /* server index */
  83.     int    top;            /* The top line of the window, screen
  84.                      * coordinates */
  85.     int    bottom;            /* The botton line of the window, screen
  86.                      * coordinates */
  87.     int    cursor;            /* The cursor position in the window, window
  88.                      * relative coordinates */
  89.     long    line_cnt;        /* counter of number of lines displayed in
  90.                      * window */
  91.     int    scroll;            /* true, window scrolls... false window wraps */
  92.     int    display_size;        /* number of lines of window - menu lines */
  93.     int    old_size;        /* if new_size != display_size,
  94.                      * resize_display is called */
  95.     int    visible;        /* true, window is drawn... false window is
  96.                      * hidden */
  97.     int    update;            /* window needs updating flag */
  98.     unsigned miscflags;        /* Miscellaneous flags. */
  99.  
  100.     char    *prompt;        /* A prompt string, usually set by EXEC'd process */
  101.     char    *status_line;        /* The status line string */
  102.  
  103.     Display    *top_of_display,    /* Pointer to first line of display structure */
  104.         *display_ip;        /* Pointer to insertiong point of display
  105.                      * structure */
  106.  
  107.     char    *current_channel;    /* Window's current channel */
  108.     char    *query_nick;        /* User being QUERY'ied in this window */
  109.     NickList    *nicks;        /* List of nicks that will go to window */
  110.     int    window_level;        /* The LEVEL of the window, determines what
  111.                      * messages go to it */
  112.  
  113.     /* hold stuff */
  114.     int    hold_mode;        /* true, hold mode is on for window...
  115.                      * false it isn't */
  116.     int    hold_on_next_rite;    /* true, the next call to rite() will
  117.                      * activate a hold */
  118.     int    held;            /* true, the window is currently being
  119.                      * held */
  120.     int    last_held;        /* Previous value of hold flag.  Used
  121.                      * for various updating needs */
  122.     Hold    *hold_head,        /* Pointer to first entry in hold
  123.                      * list */
  124.         *hold_tail;        /* Pointer to last entry in hold list */
  125.     long    held_lines;        /* number of lines being held */
  126.     long    scrolled_lines;        /* number of lines scrolled back */
  127.     long    new_scrolled_lines;    /* number of lines since scroll back
  128.                      * keys where pressed */
  129.     WindowMenu    menu;        /* The menu (if any) */
  130.  
  131.     /* lastlog stuff */
  132.     Lastlog    *lastlog_head;        /* pointer to top of lastlog list */
  133.     Lastlog    *lastlog_tail;        /* pointer to bottom of lastlog list */
  134.     int    lastlog_level;        /* The LASTLOG_LEVEL, determines what
  135.                      * messages go to lastlog */
  136.     int    lastlog_size;        /* Max number of messages for the window
  137.                      * lastlog */
  138.  
  139.     int    notify_level;        /* the notify level.. */
  140.  
  141.     char    *waiting_channel;    /* The channel that you _want_ to be on
  142.                      * this window .. derived from a real
  143.                      * fix for the phone bug */
  144.     char    *logfile;        /* window's logfile name */
  145.     /* window log stuff */
  146.     int    log;            /* true, file logging for window is on */
  147.     FILE    *log_fp;        /* file pointer for the log file */
  148.  
  149.     struct    ScreenStru    *screen;
  150.  
  151.     struct    WindowStru    *next;    /* pointer to next entry in window list (null
  152.                      * is end) */
  153.     struct    WindowStru    *prev;    /* pointer to previous entry in window list
  154.                      * (null is end) */
  155. }    Window;
  156.  
  157. /*
  158.  * WindowStack: The structure for the POP, PUSH, and STACK functions. A
  159.  * simple linked list with window refnums as the data 
  160.  */
  161. typedef    struct    window_stack_stru
  162. {
  163.     unsigned int    refnum;
  164.     struct    window_stack_stru    *next;
  165. }    WindowStack;
  166.  
  167. extern    Window    *to_window;
  168.  
  169. extern    Window    *invisible_list;
  170. extern    char    underline;
  171. extern    int    who_level;
  172. extern    char    *who_from;
  173. extern    int    in_window_command;
  174.  
  175. typedef    struct
  176. {
  177.     int    top;
  178.     int    bottom;
  179.     int    position;
  180. }    ShrinkInfo;
  181.  
  182. extern    void    set_scroll_lines();
  183. extern    void    set_scroll();
  184. extern    void    reset_line_cnt();
  185. extern    void    set_continued_line();
  186. extern    void    set_underline_video();
  187. extern    int    rite();
  188. extern    void    erase_display();
  189. extern    ShrinkInfo    resize_display();
  190. extern    void    redraw_all_windows();
  191. extern    void    add_to_screen();
  192. extern    void    init_windows();
  193. extern    int    unhold_windows();
  194. extern    Window    *traverse_all_windows();
  195. extern    void    add_to_invisible_list();
  196. extern    void    delete_window __P((Window *));
  197.  
  198. /* var_settings indexes */
  199. #define OFF 0
  200. #define ON 1
  201. #define TOGGLE 2
  202.  
  203. extern    Window    *add_to_window_list();
  204. extern    void    erase_display();
  205. extern    void    redraw_display();
  206. extern    void    add_to_display();
  207. extern    void    set_scroll();
  208. extern    void    set_menu();
  209. extern    void    set_scroll_lines();
  210. extern    int    display_hold();
  211. extern    void    update_all_status();
  212. extern    void    set_query_nick();
  213. extern    char    *query_nick();
  214. extern    void    set_current_dcc();
  215. extern    char    *current_dcc();
  216. extern    void    update_window_status();
  217. extern    void    window();
  218. extern    void    redraw_window();
  219. extern    void    redraw_all_windows();
  220. extern    void    next_window();
  221. extern    void    swap_last_window();
  222. extern    void    swap_next_window();
  223. extern    void    previous_window();
  224. extern    void    swap_previous_window();
  225. extern    void    back_window();
  226. extern    void    window_kill_swap();
  227. extern    int    is_current_channel();
  228. extern    void    redraw_all_status();
  229. extern    void    message_to();
  230. extern    void    message_from();
  231. extern    void    unstop_all_windows();
  232. extern    void    set_display();
  233. extern    unsigned int    window_display;
  234.  
  235. extern    int    is_main_screen();
  236. extern    void    kill_screen();
  237.  
  238. extern    void    set_prompt_by_refnum();
  239. extern    int    number_of_windows();
  240. extern    void    clear_window_by_refnum();
  241. extern    unsigned int    current_refnum();
  242. extern    Window    *get_window_by_refnum();
  243. extern    char    *get_target_by_refnum();
  244. extern    char    *get_prompt_by_refnum();
  245. extern    char    *set_channel_by_refnum();
  246. extern    char    *get_channel_by_refnum();
  247. extern    void    set_window_server();
  248. extern    Window    *get_window_by_name();
  249. extern    void    window_redirect();
  250. extern    int    get_window_server();
  251. extern    int    message_from_level();
  252. extern    void    restore_message_from();
  253. extern    void    save_message_from();
  254. extern    void    window_check_servers();
  255. extern    void    set_current_window();
  256. extern    void    set_level_by_refnum();
  257.  
  258. #define WINDOW_NOTIFY    ((unsigned) 0x0001)
  259. #define WINDOW_NOTIFIED    ((unsigned) 0x0002)
  260.  
  261. #endif /* _WINDOW_H_ */
  262.